<?php
/**
 * Short description for lil_app_controller.php
 *
 * @copyright     Copyright (c) 2009, Miha Nahtigal
 * @link          http://www.nahtigal.com/
 * @package       lil_blogs_plugin
 * @subpackage    lil_blogs_plugin
 * @license       http://www.opensource.org/licenses/mit-license.php The MIT License
 */
if (App::import('Controller', 'Lil.LilApp')) {
	class LilBlogsBaseAppController extends LilAppController {};
} else {
	class LilBlogsBaseAppController extends AppController {};
}
/**
 * LilBlogsAppController class
 *
 * @uses          LilAppController
 * @package       lil_blogs_plugin
 * @subpackage    lil_blogs_plugin
 */
class LilBlogsAppController extends LilBlogsBaseAppController {
/**
 * components property
 *
 * @var array
 * @access public
 */
	var $components = array('Session', 'Auth', 'RequestHandler', 'Cookie');
/**
 * helpers property
 *
 * @var array
 * @access public
 */
	var $helpers = array('Session', 'Form', 'Html', 'Text', 'Time', 'Paginator');
/**
 * kses5Setup method
 *
 * @access public
 * @return void
 */
	function kses5Setup() {
		App::import('Vendor', 'LilBlogs.kses5');

		$this->kses = new kses5();

		$this->kses->AddHTML('p', array());
		$this->kses->AddHTML('b', array());
		$this->kses->AddHTML('strong', array());
		$this->kses->AddHTML('i', array());
		$this->kses->AddHTML('em', array());
		$this->kses->AddHTML('br', array());
		$this->kses->AddHTML('address', array());
		$this->kses->AddHTML('code', array());
		$this->kses->AddHTML('pre', array());
		$this->kses->AddHTML('ol', array());
		$this->kses->AddHTML('ul', array());
		$this->kses->AddHTML('li', array());
		$this->kses->AddHTML('dl', array());
		$this->kses->AddHTML('dt', array());
		$this->kses->AddHTML('dd', array());
		$this->kses->AddHTML('blockquote', array());
		$this->kses->AddHTML('strike', array());
		$this->kses->AddHTML('q', array());
		$this->kses->AddHTML('ins', array());
		$this->kses->AddHTML('del', array());
		$this->kses->AddHTML('tt', array());
		$this->kses->AddHTML('sub', array());
		$this->kses->AddHTML('sup', array());
		$this->kses->AddHTML('var', array());
		$this->kses->AddHTML('cite', array());
		$this->kses->AddHTML('acronym', array('lang' => 1, 'title' => 1));
		$this->kses->AddHTML('abbr', array('lang' => 1, 'title' => 1));
		$this->kses->AddHTML('a', array('href' => 1, 'hreflang' => 1,'rel' => 1));
	}
/**
 * kses5Clean function
 *
 * @param string $item
 * @access public
 * @return string
 */
	function kses5Clean($item) {
		if (empty($this->kses)) {
			$this->kses5Setup();
		}
		$item = preg_replace('/<([^a-zA-Z\/])/', '&lt;$1', $item);
		$item = $this->kses->Parse($item);
		return $item;
	}
}